﻿
Imports VN.INS.DL.DH
Imports VN.INS.BL.BE

Public Class GeneralDA

    Public Function ListaTablaGeneral(ByVal strTabla As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT CODIGO, DESCRIPCION FROM GENERAL WHERE ESTADO = 'A' AND ID = '" + strTabla + "'"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaOficinaZonal(ByVal persona As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT OZ.OFICINA_ZONAL, OZ.DESCRIPCION FROM OFICINA_ZONAL OZ INNER JOIN PERSONA P ON OZ.OFICINA_ZONAL = P.OFICINA_ZONAL "
            If persona <> "" Then
                lxc_SQL = lxc_SQL + " WHERE P.PERSONA = '" & persona & "'"
            End If
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaPlanTrabajoMensualActivo(ByVal strAnho As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT PERIODO, DESCRIPCION FROM PERIODO WHERE TIPO_PERIODO = 'PLAN_TRABAJO_INGRESO' AND ANHIO = '" & strAnho & "' AND ESTADO = '1' ORDER BY PERIODO"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaMes(ByVal v_Ano As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        'Dim lxc_SQL As String
        Try
            'lxc_SQL = "SELECT PERIODO, DESCRIPCION FROM PERIODO WHERE TIPO_PERIODO = 'PLAN_TRABAJO_INGRESO' AND ANHIO = '" & ano & "' ORDER BY PERIODO"
            'objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            objData.CreateInputOracle("v_Ano", v_Ano, 4)
            objData.CreateOutputOracle("p_Cursor", "", 100)
            objDt = objData.ExecuteOracle("SP_PERIODO_PT", "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaMes(ByVal strPersona As String, ByVal param As String, ByVal strAnho As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Dim strAux As String = If(param = "", "%", "1")

        Try
            lxc_SQL = "SELECT P.PERIODO, P.DESCRIPCION FROM PERIODO P " & _
                    "WHERE P.TIPO_PERIODO = 'PLAN_TRABAJO_INGRESO' " & _
                    "AND P.PERIODO " & param & " IN (SELECT DISTINCT PTP.PERIODO " & _
                    "        FROM PLAN_TRABAJO_PERSONA PTP " & _
                    "       INNER JOIN PLAN_TRABAJO_POA PTO " & _
                    "        ON PTO.ID_PLAN_TRABAJO_PERSONA = PTP.ID_PLAN_TRABAJO_PERSONA " & _
                    "        INNER JOIN POA P " & _
                    "        ON P.POA = PTO.POA "
            If strPersona = "" Then
                lxc_SQL = lxc_SQL & " ) "
            Else
                lxc_SQL = lxc_SQL & " WHERE '" & strPersona & "' IN (PTP.PERSONA_MONITOREO, PTP.JEFE_INMEDIATO, P.PERSONA_ESPECIALISTA) " & _
                    "        ) "
            End If



            'By Tigrito(20/06/2013)
            lxc_SQL = lxc_SQL & " AND P.ESTADO LIKE '" & strAux & "' ORDER BY PERIODO"
            ' lxc_SQL = lxc_SQL & " AND ANHIO = '" & strAnho & "' AND P.ESTADO LIKE '" & strAux & "' ORDER BY PERIODO"
            'lxc_SQL = lxc_SQL & " AND ANHIO = '" & strAnho & "' ORDER BY PERIODO"

            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaMesFichaMonitoreo(ByVal strPersona As String, ByVal param As String, ByVal strAnho As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT SUBSTR(P.PERIODO, 1,6) PERIODO, P.DESCRIPCION FROM PERIODO P " & _
                    "WHERE P.TIPO_PERIODO = 'FICHA_MONITOREO_INGRESO' " & _
                    "AND P.PERIODO " & param & " IN (SELECT DISTINCT PTP.PERIODO || 'FMI' " & _
                    "        FROM PLAN_TRABAJO_PERSONA PTP " & _
                    "       INNER JOIN PLAN_TRABAJO_POA PTO " & _
                    "        ON PTO.ID_PLAN_TRABAJO_PERSONA = PTP.ID_PLAN_TRABAJO_PERSONA " & _
                    "        INNER JOIN POA P " & _
                    "        ON P.POA = PTO.POA "
            If strPersona = "" Then
                lxc_SQL = lxc_SQL & " ) "
            Else
                lxc_SQL = lxc_SQL & " WHERE '" & strPersona & "' IN (PTP.PERSONA_MONITOREO, PTP.JEFE_INMEDIATO, P.PERSONA_ESPECIALISTA) " & _
                    "        ) "
            End If
            'By Tigrito(20/06/2013)
            'lxc_SQL = lxc_SQL & " AND ANHIO = '" & ano & "' AND ESTADO = '1' ORDER BY PERIODO"
            lxc_SQL = lxc_SQL & " AND ANHIO = '" & strAnho & "' ORDER BY PERIODO"

            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaMesInforme(ByVal strPersona As String, ByVal param As String, ByVal strAnho As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT SUBSTR(P.PERIODO, 1,6) PERIODO, P.DESCRIPCION FROM PERIODO P " & _
                    "WHERE P.TIPO_PERIODO = 'INFORME_MENSUAL_INGRESO' " & _
                    "AND P.PERIODO " & param & " IN (SELECT DISTINCT PTP.PERIODO || 'IMI' " & _
                    "        FROM PLAN_TRABAJO_PERSONA PTP " & _
                    "       INNER JOIN PLAN_TRABAJO_POA PTO " & _
                    "        ON PTO.ID_PLAN_TRABAJO_PERSONA = PTP.ID_PLAN_TRABAJO_PERSONA " & _
                    "        INNER JOIN POA P " & _
                    "        ON P.POA = PTO.POA "
            If strPersona = "" Then
                lxc_SQL = lxc_SQL & " ) "
            Else
                lxc_SQL = lxc_SQL & " WHERE '" & strPersona & "' IN (PTP.PERSONA_MONITOREO, PTP.JEFE_INMEDIATO, P.PERSONA_ESPECIALISTA) " & _
                    "        ) "
            End If
            'By Tigrito(20/06/2013)
            'lxc_SQL = lxc_SQL & " AND ANHIO = '" & ano & "' AND ESTADO = '1' ORDER BY PERIODO"
            lxc_SQL = lxc_SQL & " AND ANHIO = '" & strAnho & "' ORDER BY PERIODO"

            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function GenerarCodigo(ByVal strTabla As String, ByVal strCampo As String, ByVal strPrefijo As String) As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Dim strCodigo As String
        Dim strNumero As Integer
        Try
            lxc_SQL = "select " & strCampo & " from (select " & strCampo & " FROM " & strTabla & " order by " & strCampo & " desc) "
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            If objDt.Rows.Count > 0 Then
                lxc_SQL = lxc_SQL + " where rownum=1 "
                objDt = Nothing
                objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            End If
            If objDt.Rows.Count = 0 Then
                strCodigo = strPrefijo + "0001"
            Else
                strCodigo = objDt.Rows(0)(strCampo).ToString
                strNumero = Integer.Parse(strCodigo.Substring(strPrefijo.Length)) + 1
                Dim s As String = ""
                If strNumero.ToString.Length < 4 Then
                    For i As Integer = 1 To 4 - strNumero.ToString.Length
                        s += "0"
                    Next
                    s += strNumero.ToString
                Else
                    s = "Error"
                End If
                strCodigo = strPrefijo + s
            End If
            Return strCodigo
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function GenerarCodigoNumero(ByVal strTabla As String, ByVal strCampo As String) As Integer
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Dim intCodigo As Integer
        Try
            lxc_SQL = "select " & strCampo & " from (select " & strCampo & " FROM " & strTabla & " order by " & strCampo & " desc) "
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            If objDt.Rows.Count > 0 Then
                lxc_SQL = lxc_SQL + " where rownum=1 "
                objDt = Nothing
                objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            End If
            If objDt.Rows.Count = 0 Then
                intCodigo = 1
            Else
                intCodigo = CInt(objDt.Rows(0).Item(strCampo).ToString) + 1
            End If
            Return intCodigo
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function GenerarCodigoNumeroString(ByVal strTabla As String, ByVal strCampo As String) As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Dim intCodigo As Integer
        Try
            lxc_SQL = "select " & strCampo & " from (SELECT " & strCampo & " FROM " & strTabla & " order by LPAD(" & strCampo & ",8,'0')  DESC) "
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            If objDt.Rows.Count > 0 Then
                lxc_SQL = lxc_SQL + " where rownum=1 "
                objDt = Nothing
                objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            End If
            If objDt.Rows.Count = 0 Then
                intCodigo = 1
            Else
                intCodigo = CInt(objDt.Rows(0).Item(strCampo).ToString) + 1
            End If
            Return intCodigo.ToString
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function FechaAvanceSemanal(ByVal strAnhioFirma As String) As String
        Dim strFecha As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT PERIODO || '#' || DESCRIPCION AS DESCRIPCION FROM PERIODO WHERE TIPO_PERIODO = 'AVANCE_SEMANAL' AND ANHIO = '" + strAnhioFirma + "' AND ESTADO = '1'"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            If objDt.Rows.Count > 0 Then
                strFecha = objDt.Rows(0).Item("DESCRIPCION").ToString
            Else
                strFecha = Nothing
            End If
            Return strFecha
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    'By Tigrito 09/05/2013
    Public Function PeriodoAnteriorAvanceSemanal(ByVal strAnhioActivo As String) As String
        Dim strFecha As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT MAX(TO_NUMBER(PERIODO)) Periodo_Anterior  " & _
                      "FROM PERIODO " & _
                      "WHERE TIPO_PERIODO = 'AVANCE_SEMANAL' AND " & _
                                "ANHIO = '" + strAnhioActivo + "' AND  " & _
                                "ESTADO = '0'"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            If objDt.Rows.Count > 0 Then
                strFecha = objDt.Rows(0).Item("Periodo_Anterior").ToString
            Else
                strFecha = Nothing
            End If
            Return strFecha
        Catch ex As Exception
            Throw ex
        End Try
    End Function



    Public Function FechaAvanceMensual() As String
        Dim strFecha As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT PERIODO || '#' || DESCRIPCION AS DESCRIPCION FROM PERIODO WHERE TIPO_PERIODO = 'AVANCE_FINAN_MENSUAL' AND ESTADO = '1'"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            If objDt.Rows.Count > 0 Then
                strFecha = objDt.Rows(0).Item("DESCRIPCION").ToString
            Else
                strFecha = Nothing
            End If
            Return strFecha
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function EstadoFecha(ByVal strPeriodo As String) As String
        Dim strEstado As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT ESTADO FROM PERIODO WHERE TIPO_PERIODO = 'AVANCE_SEMANAL' AND PERIODO='" & strPeriodo & "'"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            strEstado = objDt.Rows(0).Item("ESTADO").ToString
            Return strEstado
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function EstadoFechaMensual(ByVal strPeriodo As String) As String
        Dim strEstado As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT ESTADO FROM PERIODO WHERE TIPO_PERIODO = 'AVANCE_FINAN_MENSUAL' AND PERIODO='" & strPeriodo & "'"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            strEstado = objDt.Rows(0).Item("ESTADO").ToString
            Return strEstado
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function EstadoFechaPAC(ByVal strPeriodo As String) As String
        Dim strEstado As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT ESTADO FROM PERIODO WHERE TIPO_PERIODO = 'AVANCE_PAC' AND PERIODO='" & strPeriodo & "'"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            strEstado = objDt.Rows(0).Item("ESTADO").ToString
            Return strEstado
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaPeriodoReporte(ByVal strEstado As String, ByVal strOrden As String, ByVal ano As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT PERIODO, DESCRIPCION FROM PERIODO WHERE TIPO_PERIODO = 'AVANCE_SEMANAL' AND ESTADO LIKE '" & strEstado & "%' AND ANHIO = '" & ano & "' ORDER BY ESTADO DESC,TO_NUMBER(PERIODO) " & strOrden
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaPeriodoMensual(ByVal strEstado As String, ByVal strOrden As String, ByVal ano As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT PERIODO, DESCRIPCION FROM PERIODO WHERE TIPO_PERIODO = 'AVANCE_FINAN_MENSUAL' AND ESTADO LIKE '" & strEstado & "%' AND ANHIO = '" & ano & "' ORDER BY ESTADO DESC,TO_NUMBER(PERIODO) " & strOrden
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaEjecutor() As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT EJECUTOR, DESCRIPCION FROM EJECUTOR ORDER BY DESCRIPCION"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaRegion(ByVal strPPER As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT DISTINCT U.UBIGEO, U.NOMBRE " & _
                      "FROM UBIGEO U " & _
                      "LEFT JOIN POA P ON P.UBIGEO = U.UBIGEO " & _
                      "WHERE PROVINCIA = '00' AND DISTRITO = '00' "
            If strPPER <> "" Then
                lxc_SQL = lxc_SQL + "AND P.PPER = '" & strPPER & "' "
            End If
            lxc_SQL = lxc_SQL + "ORDER BY UBIGEO"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaProvincia(ByVal strPPER As String, ByVal strUbigeo As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT DISTINCT U.UBIGEO, U.NOMBRE " & _
                        "FROM UBIGEO U " & _
                        "LEFT JOIN POA P ON P.UBIGEO = U.UBIGEO " & _
                        "WHERE " & _
                            "DEPARTAMENTO = SUBSTR('" & strUbigeo & "',1,2) AND " & _
                            "DISTRITO = '00'"
            If strPPER <> "" Then
                lxc_SQL = lxc_SQL + "AND P.PPER = '" & strPPER & "' "
            End If
            lxc_SQL = lxc_SQL + "ORDER BY UBIGEO"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function ListaDistrito(ByVal strPPER As String, ByVal strUbigeo As String) As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT DISTINCT U.UBIGEO, U.NOMBRE " & _
                      "FROM UBIGEO U " & _
                      "LEFT JOIN POA P ON P.UBIGEO = U.UBIGEO " & _
                      "WHERE " & _
                                    "DEPARTAMENTO = SUBSTR('" & strUbigeo & "',1,2) AND  " & _
                                    "PROVINCIA = SUBSTR('" & strUbigeo & "',3,4)"

            If strPPER <> "" Then
                lxc_SQL = lxc_SQL + "AND P.PPER = '" & strPPER & "' "
            End If
            lxc_SQL = lxc_SQL + "ORDER BY UBIGEO"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Sub Acceso_Sistema(ByVal strUsuario As String)
        Dim objData As AdministradorOracle = New AdministradorOracle
        Try
            objData.CreateInputOracle("USU", strUsuario, 8)
            objData.ExecuteOracle_NonQuery("INSERTAR_ACCESO_SISTEMA", "Conexion.Oracle")
        Catch ex As Exception
            Throw ex
        End Try
    End Sub

    Public Function CargaAnoActivo() As DataTable
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT DESCRIPCION FROM GENERAL WHERE ID = 'ANHIO' AND PARAMETRO = '1'"
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            Return objDt
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function Periodo_Activo_Ficha_Monitoreo(ByVal strPer As String) As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim strPeriodo As String
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT SUBSTR(PERIODO,1,6) PERIODO " & _
                      " FROM PERIODO " & _
                      " WHERE TIPO_PERIODO = 'FICHA_MONITOREO_INGRESO' " & _
                      " AND ESTADO = '1'" & _
                      " AND SUBSTR(PERIODO,1,6) = '" & strPer & "'"

            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")
            If objDt.Rows.Count = 0 Then
                strPeriodo = ""
            Else
                strPeriodo = objDt.Rows(0).Item("PERIODO").ToString
            End If
            Return strPeriodo
        Catch ex As Exception
            Throw ex
        End Try
    End Function

    Public Function Verificar_Periodo_Activo_General(ByVal strTipoPeriodo As String, ByVal strPeriodo As String) As String
        Dim objData As AdministradorOracle = New AdministradorOracle
        Dim objDt As DataTable
        Dim Respuesta As String
        Dim lxc_SQL As String
        Try
            lxc_SQL = "SELECT SUBSTR(PERIODO,1,6) PERIODO " & _
                        "FROM PERIODO " & _
                        "WHERE TIPO_PERIODO = '" + strTipoPeriodo + "'  AND " & _
                                    "ESTADO = '1' AND " & _
                                    "SUBSTR(PERIODO,1,6) = '" + strPeriodo + "' "
            objDt = objData.ExecuteSQL(lxc_SQL, "Conexion.Oracle")

            If objDt.Rows.Count = 0 Then
                Respuesta = "0"
            Else
                'strPeriodo = objDt.Rows(0).Item("PERIODO").ToString
                Respuesta = "1"
            End If
            Return Respuesta
        Catch ex As Exception
            Throw ex
        End Try
    End Function

End Class
